<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<script src="${initParam.root }/jquery-1.8.3.js"></script>
<script src="${initParam.root }/scripts/recipe/favorite_script.js"></script>
<script type="text/javascript">
		 $(document).ready(function(){
			  $(".listTxt").hide();
			  $(".listDeleteBtn").hide();
			  $(".listImg").hover(function(){
				  $(this).find(".fp").css("zIndex","1");
				  $(this).children(".listTxt").show();
				  $(this).children(".listDeleteBtn").show();
				  $(this).find(".fp").stop().animate({ opacity: 0.3 }, 200);
			  },
			  function(){
				  $(this).find(".fp").css("zIndex","7");
			   $(this).children(".listTxt").hide();
			   $(this).children(".listDeleteBtn").hide();
			   $(this).find(".fp").stop().animate({ opacity: 1.0 }, 200);
			  });
		 });
</script>
   <meta charset="utf-8" />
    <link rel="stylesheet" href="${initParam.root}/css/favorite_styles.css" />
	<header>
		<h2>
			<img src="${initParam.root }/img/main/main-favorite-title.gif" alt="RapidXHTML" />
		</h2>
	</header>
		<hr color="#FF9436">
        <a class="arrow prev">Prev</a>
        <a class="arrow next">Next</a>
        <div id="main">
        	<ul id="carousel">
				<c:forEach items="${requestScope.list }" var="list">
					<li class="visible">
					<div class="listImg" align="center">
					<span class="listTxt" onclick="parent.location='recipe.do?command=getContent&r_no=${list.R_NO }&m_id=${list.M_ID }&page=1'" style="cursor: pointer;">
					${list.R_DATE }<br>
					조회수 : ${list.R_CNT }<br>
					평점 : <br>	
					<c:choose>
						<c:when test="${list.R_GCNT>0 }">
							<c:if test="${list.R_TOTALGRADE div list.R_GCNT >4.5}">
							 <img alt="grade" src="${initParam.root }/img/bbom&search/main-grade-5.png">
      						</c:if>
							<c:if test="${list.R_TOTALGRADE div list.R_GCNT >=4.5 and list.R_TOTALGRADE div list.R_GCNT<5}">
									 <img alt="grade" src="${initParam.root }/img/bbom&search/main-grade-4.5.png">
      						</c:if>
      							<c:if test="${list.R_TOTALGRADE div list.R_GCNT >=4 and list.R_TOTALGRADE div list.R_GCNT<4.5}">
									 <img alt="grade" src="${initParam.root }/img/bbom&search/main-grade-4.png">
      						</c:if>
      						<c:if test="${list.R_TOTALGRADE div list.R_GCNT >=3.5 and list.R_TOTALGRADE div list.R_GCNT<4}">
      							<img alt="grade" src="${initParam.root }/img/bbom&search/main-grade-3.5.png">
      						</c:if>
      							<c:if test="${list.R_TOTALGRADE div list.R_GCNT >=3 and list.R_TOTALGRADE div list.R_GCNT<3.5}">
      							<img alt="grade" src="${initParam.root }/img/bbom&search/main-grade-3.png">
      						</c:if>
      							<c:if test="${list.R_TOTALGRADE div list.R_GCNT >=2.5 and list.R_TOTALGRADE div list.R_GCNT<3}">
      							<img alt="grade" src="${initParam.root }/img/bbom&search/main-grade-2.5.png">
      						</c:if>
      							<c:if test="${list.R_TOTALGRADE div list.R_GCNT >=2 and list.R_TOTALGRADE div list.R_GCNT<2.5}">
      							<img alt="grade" src="${initParam.root }/img/bbom&search/main-grade-2.png">
      						</c:if>
      						<c:if test="${list.R_TOTALGRADE div list.R_GCNT >=1.5 and list.R_TOTALGRADE div list.R_GCNT<2}">
      							<img alt="grade" src="${initParam.root }/img/bbom&search/main-grade-1.5.png">
      						</c:if>
      						<c:if test="${list.R_TOTALGRADE div list.R_GCNT >=1 and list.R_TOTALGRADE div list.R_GCNT<1.5}">
      							<img alt="grade" src="${initParam.root }/img/bbom&search/main-grade-1.png">
      						</c:if>
      						<c:if test="${list.R_TOTALGRADE div list.R_GCNT >=0.5 and list.R_TOTALGRADE div list.R_GCNT<1}">
      							<img alt="grade" src="${initParam.root }/img/bbom&search/main-grade-1.png">
      						</c:if>
      						<c:if test="${list.R_TOTALGRADE div list.R_GCNT >0 and list.R_TOTALGRADE div list.R_GCNT<0.5}">
      							<img alt="grade" src="${initParam.root }/img/bbom&search/main-grade-0.5.png">
      						</c:if>
      						</c:when>
							<c:otherwise>
								평가해주세요!
							</c:otherwise>
							</c:choose>
					</span>
					<span class="listDeleteBtn"  onclick="parent.location='recipe.do?command=deleteFavorite&r_no=${list.R_NO }&m_id=${list.M_ID }&page=header'">
						<input type="button" value="삭제" class="button_img" style="width:50px; height: 50px; font-size: 12pt;">
					</span>
					<a href="recipe.do?command=getContent&r_no=${list.R_NO }&m_id=${list.M_ID }&page=1"  ><img class="fp"
							src="${initParam.imgRoot }${list.R_IMG_NEW }" alt="RapidXHTML" /></div></a>
						<span class="ListTitle">${list.R_TITLE }</span><br>
						<span class="ListWriter">${list.R_WRITER }</span></li>
				</c:forEach>
        	</ul>
        </div>
        	<hr color="#FF9436" style="margin-top: -50px;">
   
        
